package com.csdj.controller.Be;

import com.csdj.common.enums.AppHttpCodeEnum;
import com.csdj.common.utils.ResponseResult;
import com.csdj.pojo.SyMetertype;
import com.csdj.service.SyMetertypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * SY_MeterType表
 * @author 段文海
 */
@RestController
@RequestMapping("/syMeterType")
public class SyMeterTypeController {
    //实例
    @Autowired
    private SyMetertypeService syMetertypeService;

    /**
     * 获取所有水表型号
     */
    @GetMapping
    public ResponseResult getAll(){
        List<SyMetertype> list = syMetertypeService.list();
        return list.isEmpty()?ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"服务器正在忙碌中,请稍后重试"):ResponseResult.okResult(list);
    }
}
